package cn.xutongxue.interview.service;

import cn.xutongxue.interview.entity.QuestionBankMap;
import cn.xutongxue.interview.entity.dto.question.QuestionRemoveBatch;
import cn.xutongxue.interview.entity.dto.questionBankMap.QuestionBankMapAddBatchDto;
import cn.xutongxue.interview.entity.dto.questionBankMap.QuestionBankMapRemoveBatchDto;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author Administrator
* @description 针对表【question_bank_map(题库题目关联表)】的数据库操作Service
* @createDate 2024-09-11 16:43:44
*/
public interface QuestionBankMapService extends IService<QuestionBankMap> {

    /**
     * 批量添加题目到题库
     * @param bankId 题库id
     * @param questionIdList 题目id列表
     */
    void addQuestionToBankBatch(Long bankId, List<Long> questionIdList);

    /**
     * 批量删除题目题库关联
     * @param removeBatchDto 待删除的关联信息
     */
    void deleteQuestionBankMapBatch(QuestionBankMapRemoveBatchDto removeBatchDto);

    /**
     * 批量插入题目到题库 - 事务内部调用
     * @param questionBankMapList 待插入关系数据集合
     */
    @Transactional(rollbackFor = Exception.class)
    void addQuestionToBankBatchInner(List<QuestionBankMap> questionBankMapList);
}
